package sc.core.auth.enums;

import java.util.ArrayList;

public enum RoleEnum {

	CUSTOMER("CUSTOMER", "CUSTOMER", Wrap(PermissionEnum.ROLE_USER,
			PermissionEnum.DEMO_AUTH_CUSTOMER)),

	ADMIN("ADMIN", "ADMIN", Wrap(PermissionEnum.ROLE_USER,
			PermissionEnum.DEMO_AUTH_ADMIN));

	private RoleEnum(String roleName, String roleDescription,
			ArrayList<PermissionEnum> perms) {
		this.roleName = roleName;
		this.roleDescription = roleDescription;
		this.perms = perms;
	}

	final String roleName;
	final String roleDescription;
	final ArrayList<PermissionEnum> perms;

	public String getRoleName() {
		return roleName;
	}

	public String getRoleDescription() {
		return roleDescription;
	}

	public ArrayList<PermissionEnum> getPerms() {
		return perms;
	}

	static ArrayList<PermissionEnum> Wrap(PermissionEnum... perms) {
		ArrayList<PermissionEnum> ps = new ArrayList<PermissionEnum>();
		for (PermissionEnum p : perms)
			ps.add(p);
		return ps;
	}
}
